﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Page_BusinessRegist.aspx.cs" Inherits="WebBusiness_Page_BusinessRegist" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script src="../JS/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../JS/formValidator-4.0.1.min.js" type="text/javascript"></script>
    <script src="../JS/formValidatorRegex.js" type="text/javascript"></script>
    <link href="../CSS/validator.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {
            $.formValidator.initConfig({ formID: "aspnetForm", autoTip: true });
            $("#myRegist").click(function () {
                if ($.formValidator.pageIsValid('1')) {
                    $("#action").val("regist");
                }
            });
            $("#userName").formValidator({ ajax: true, onShow: "请输入账号", onfocus: "最好以字母开头，只能由字母数字组成 ,不能少于6个字符。",
                onCorrect: "用户名可以使用，请完善下面信息。"
            }).regexValidator({ regExp: "username", dataType: "enum", onError: "你输入的格式不正确！" }).
                        inputValidator({ min: 6, max: 16, onError: "输入长度不正确！" })
                         .ajaxValidator({
                             dataType: "text",
                             async: true,
                             url: "../Handler.ashx",
                             success: function (data) {
                                 if (data == "0") { return true; }
                                 else if (data == "null") { return "注意：用户名不能少于6个字符。"; }
                                 else if (data == "false") { return false; }
                             },
                             error: function (jqXHR, textStatus, errorThrown) { alert("服务器没有返回数据，可能服务器忙，请重试" + errorThrown); },
                             onError: "该用户名不可用，请更换用户名",
                             onWait: "正在对用户名进行合法性校验，请稍候..."
                         });
            $("#userPhone").formValidator({ empty: true, onShow: "请输入你的手机或电话，可以为空哦", onFocus: "格式例如：0577-88888888或11位手机号码",
                onCorrect: "验证通过", onEmpty: "你真的不想留手机或电话了吗？"
            }).regexValidator({ regExp: ["tel", "mobile"], dataType: "enum", onError: "你输入的手机或电话格式不正确" });
            $("#password1").formValidator({ onShow: "请输入密码", onFocus: "至少1个长度", onCorrect: "验证通过" }).inputValidator({ min: 1, empty: { leftEmpty: false, rightEmpty: false, emptyError: "密码两边不能有空符号" }, onError: "密码不能为空,请确认" });
            $("#password2").formValidator({ onShow: "输再次输入密码", onFocus: "至少1个长度", onCorrect: "验证通过" }).inputValidator({
                min: 1, empty: { leftEmpty: false, rightEmpty: false, emptyError: "重复密码两边不能有空符号" }, onError: "重复密码不能为空,请确认"
            }).compareValidator({ desID: "password1", operateor: "=", onError: "2次密码不一致,请确认" });
            $("#industry").formValidator({ onShow: "请选择你的行业", onFocus: "行业必须选择", onCorrect: "验证通过" }).
                                    inputValidator({ min: 1, onError: "你是不是忘记选择行业了!" });
            $("#email").formValidator({ onShow: "请输入邮箱", onFocus: "邮箱6-100个字符", onCorrect: "验证通过", defaultValue: "@" }).
                inputValidator({ min: 6, max: 100, onError: "你输入的邮箱长度非法,请确认" }).
                regexValidator({ regExp: "email", dataType: "enum", onError: "你输入的邮箱格式不正确" });
            $("#myRegist").attr("disabled", "disabled");
            $("#checkBoxAgree").click(function () {
                if ($("#checkBoxAgree").attr("checked") == true) {
                    $("#myRegist").attr("disabled", "");
                } else {
                    $("#myRegist").attr("disabled", "disabled");
                }
            })
        });
    </script>
    <table bgcolor="#DDF1FC" width="100%">
        <tr>
            <td align="center">
                <img src="../images/wd_banner%20(1).png" />
            </td>
        </tr>
    </table>
    <table width="984" align="center">
        <tr>
            <td>
                <h2 style="font-size: 22px; line-height: 35px; font-weight: normal; font-family: '微软雅黑';
                    color: #228bcd">
                    注册申请</h2>
                <hr />
            </td>
        </tr>
        <tr>
            <td>
                <br />
                用户名称:<input type="text" id="userName" name="userName" style="width: 230px; height: 20px" />
            </td>
            <td>
                <div id="userNameTip">
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <br />
                手机号码:<input type="text" id="userPhone" name="userPhone" style="width: 230px; height: 20px" />
            </td>
            <td>
                <div id="userPhoneTip">
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <br />
                登录密码:<input type="text" id="password1" name="password1" style="width: 230px; height: 20px" />
            </td>
            <td>
                <div id="password1Tip">
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <br />
                确认密码:<input type="text" id="password2" name="password2" style="width: 230px; height: 20px" />
            </td>
            <td>
                <div id="password2Tip">
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <br />
                行业选择:
                <select id="industry" name="industry" style="width: 230px; height: 20px">
                    <option value="">－－请选择你的行业－－</option>
                    <option value="1">注塑</option>
                    <option value="2">电子</option>
                    <option value="3">制衣</option>
                    <option value="4">手袋</option>
                    <option value="5">模具</option>
                    <option value="6">喷油</option>
                    <option value="7">印刷</option>
                    <option value="8">加工</option>
                    <option value="9">电镀</option>
                    <option value="10">线路板</option>
                    <option value="11">物业</option>
                    <option value="12">中介</option>
                    <option value="13">其它</option>
                </select>
            </td>
            <td id="industryTip">
            </td>
        </tr>
        <tr>
            <td>
                <br />
                验证邮箱:<input id="email" name="email" style="width: 230px; height: 20px" />
            </td>
            <td id="emailTip">
            </td>
        </tr>
        <tr>
            <td>
                <br />
                <input type="checkbox" id="checkBoxAgree" /><label>我同意318厂房网注册协议</label>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Page_RegistServices.aspx"
                    ForeColor="Blue">查看318协议</asp:HyperLink>
            </td>
        </tr>
        <tr>
            <td>
                <br />
                &nbsp;&nbsp;
                <input type="submit" name="myRegist" id="myRegist" value="·申请注册·" style="height: 27px;
                    width: 95px" />
            </td>
        </tr>
        <tr>
            <td>
                <br />
                &nbsp;&nbsp; <a style="height: 27px; width: 95px" href="../Login.aspx">已有帐号?直接登录</a>
            </td>
        </tr>
    </table>
    <input type="hidden" id="action" name="action" />
    <br />
    <br />
</asp:Content>
